home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Robotics & Artificial Int…3 (Professional Edition)
/
Robotics & Artificial Intelligence Tools 2003 (Professional Edition).iso
/
robot software
/
webots-kros-1.0.1_setup.exe
/
{app}
/
kteam
/
etc
/
PICIFY.awk
< prev
Wrap
Text File
|
2002-05-08
|
2KB
|
80 lines
# Convert GCC Assembler Output done with -fPIC under gcc 2.95.2
# from shared library PIC to embedded Position Independent
# Code & Data
# Copyright (C) 2000 K-Team S.A.
# Initialize the array of static
#BEGIN {si=1;}
# Look for static variables .comm
#(match($1,".comm"))\
#{
# print $0;
# split($2,def,/,/);
# statics[si]=def[1];
# si++;
# next;
#}
# Change bsr LABEL@PLTPC in bsr.l LABEL@PLTPC
(match($2,"@PLTPC"))&&($1=="bsr") {print "\tbsr.l",$2;next;}
# Suppress lea (%pc, _GLOBAL_OFFSET_TABLE_@GOTPC), %a5
#(match($3,"@GOTPC"))&&($1=="lea") {;next;}
# Transform @GOT(%a5) statements
#index($2,"@GOT(%a5)")\
# {
# ins1 = $1;
# ops1 = $2;
# split(ops1,op1,/,/);
# src1 = op1[1];
# dest1 = op1[2];
# for (stat in statics)
# {
# if (index(src1,statics[stat]))
# {
# sub(/@GOT.%a5./,"(%a5)",src1);
# print ins1,src1,",",dest1;
# next;
# }
# }
# if (index(dest1,"%sp"))
# {
# # Transform move.l LABEL@GOT(%a5),%sp in pea%pc@(LABEL)
# sub(/@GOT.%a5./,")",src1);
# print "\tpea","%pc@(",src1;
# }
# else if (index(dest1,"%d"))
# {
# # Transform xxx LABEL@GOT(%a5),%dx in pea%pc@(LABEL) + xxx %sp@+,%dx
# sub(/@GOT.%a5./,")",src1);
# print "\tpea","%pc@(",src1;
# print "\t",ins1,"%sp@+,",dest1;
# }
# else if (index(dest1,"(%a"))
## {
# Transform xxx LABEL@GOT(%a5),y(%ax) in pea%pc@(LABEL) + xxx %sp@+,y(%ax)
# Pb de deplacement de a7 qd y=sp (aka a7)
# sub(/@GOT.%a5./,")",src1);
# print "\tpea","%pc@(",src1;
# print "\t",ins1,"%sp@+,",dest1;
# }
# else if (index(dest1,"%a"))
# {
# # Transform xxx.l LABEL@GOT(%a5),%ax in xxx%pc@(LABEL),%ax
# sub(/@GOT.%a5./,")",ops1);
# print "\t",ins1,"%pc@(",ops1;
# }
# else
# {
# print $0;
# }
# next;
# }
# Any other just print unchanged
{print $0}